package com.fdb.efp.flow.common.vo;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import com.fdb.efp.flow.common.constance.FlowConstance;
import com.fdb.efp.flow.common.enumeration.NodeExecuteType;
import com.fdb.efp.flow.common.enumeration.NodeType;
import com.fdb.basic.framework.core.vo.PluginVO;

/**
 * 
 * 流程流转传输对象
 * 
 * @author Cytus_
 * @since 2018年5月7日 下午7:10:39
 * @version 1.0
 *
 */
public class EngineVO implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 流程ID
	 */
	private String flowId;
	
	/**
	 * 流程实例ID
	 */
	private String flowInstanceId;
	
	/**
	 * 事件ID
	 */
	private String eventId;
	
	/**
	 * 事件实例ID
	 */
	private String eventInstanceId;
	
	/**
     * 节点ID
     */
	private String nodeId;
	
	/**
     * 节点实例ID
     */
	private String nodeInstanceId;
	
	/**
	 * 上一执行节点ID
	 */
	private String preNodeId;
	
	/**
     * 任务ID
     */
	private String taskId;
	
	/**
     * 上一任务ID
     */
	private String preTaskId;
	
	/**
     * 插件vo对象集合
     */
	private PluginVO pluginVo;

	/**
     * 全局流水号，同{@linkplain flowInstanceId}
     */
	private String globalBizSerno;
	
	/**
	 * 事件执行状态  参见{@link FlowConstance}类
	 */
	private String eventExecuteStatus;
	
	/**
     * 节点执行状态  参见{@link FlowConstance}类
     */
	private String nodeExecuteStatus;
	
	/**
     * 任务执行状态  参见{@link FlowConstance}类
     */
	private String taskExecuteStatus;
	
	/**
	 * 业务流水号，同{@linkplain eventInstanceId}
	 */
	private String bizSerno;
	
	/**
	 * 扩展参数对象集合
	 */
	private Map<String, Object> extParams;
	
	/**
	 * 错误代码
	 */
	private String errorCode;
	
	/**
	 * 错误信息
	 */
	private String errorMessage;
	
	/**
	 * 节点执行类型 默认{@link NodeExecuteType}.{@linkplain NATURE}
	 */
	private NodeExecuteType nodeExecuteType = NodeExecuteType.NATURE;
	
	/**
     * 节点类型 默认{@link NodeType}.{@linkplain NODE_BIZ}
     */
	private NodeType nodeType = NodeType.NODE_BIZ;
	
	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public Map<String, Object> getExtParams() {
		if (Objects.isNull(this.extParams))
			this.extParams = new HashMap<String, Object>();
		return extParams;
	}

	public void setExtParams(Map<String, Object> extParams) {
		this.extParams = extParams;
	}
	
	public void addExeParams(String key, Object value) {
		if (Objects.isNull(this.extParams))
			this.extParams = new HashMap<String, Object>();
		this.extParams.put(key, value);
	}

	public String getBizSerno() {
		return bizSerno;
	}

	public void setBizSerno(String bizSerno) {
		this.bizSerno = bizSerno;
	}


	public String getFlowId() {
		return flowId;
	}

	public void setFlowId(String flowId) {
		this.flowId = flowId;
	}

	public String getFlowInstanceId() {
		return flowInstanceId;
	}

	public void setFlowInstanceId(String flowInstanceId) {
		this.flowInstanceId = flowInstanceId;
	}

	public String getEventId() {
		return eventId;
	}

	public void setEventId(String eventId) {
		this.eventId = eventId;
	}

	public String getEventInstanceId() {
		return eventInstanceId;
	}

	public void setEventInstanceId(String eventInstanceId) {
		this.eventInstanceId = eventInstanceId;
	}

	public String getNodeId() {
		return nodeId;
	}

	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}

	public String getNodeInstanceId() {
		return nodeInstanceId;
	}

	public void setNodeInstanceId(String nodeInstanceId) {
		this.nodeInstanceId = nodeInstanceId;
	}

	public String getTaskId() {
		return taskId;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}

	public PluginVO getPluginVo() {
	    if (Objects.isNull(pluginVo)) {
	        this.pluginVo = new PluginVO();
	    }
		return pluginVo;
	}
	
	public void setPluginVo(PluginVO pluginVo) {
		this.pluginVo = pluginVo;
	}

/*	public ExecuteStatus getEventExecuteStatus() {
		return eventExecuteStatus;
	}

	public void setEventExecuteStatus(ExecuteStatus eventExecuteStatus) {
		this.eventExecuteStatus = eventExecuteStatus;
	}

	public ExecuteStatus getNodeExecuteStatus() {
		return nodeExecuteStatus;
	}*/

	public String getPreNodeId() {
		return preNodeId;
	}

	public void setPreNodeId(String preNodeId) {
		this.preNodeId = preNodeId;
	}

	public String getPreTaskId() {
		return preTaskId;
	}

	public void setPreTaskId(String preTaskId) {
		this.preTaskId = preTaskId;
	}

	public String getEventExecuteStatus() {
		return eventExecuteStatus;
	}

	public void setEventExecuteStatus(String eventExecuteStatus) {
		this.eventExecuteStatus = eventExecuteStatus;
	}

	public String getNodeExecuteStatus() {
		return nodeExecuteStatus;
	}

	public void setNodeExecuteStatus(String nodeExecuteStatus) {
		this.nodeExecuteStatus = nodeExecuteStatus;
	}

	public String getTaskExecuteStatus() {
		return taskExecuteStatus;
	}

	public void setTaskExecuteStatus(String taskExecuteStatus) {
		this.taskExecuteStatus = taskExecuteStatus;
	}

	public String getGlobalBizSerno() {
		return globalBizSerno;
	}

	public void setGlobalBizSerno(String globalBizSerno) {
		this.globalBizSerno = globalBizSerno;
	}

	public NodeExecuteType getNodeExecuteType() {
		return nodeExecuteType;
	}

	public void setNodeExecuteType(NodeExecuteType nodeExecuteType) {
		this.nodeExecuteType = nodeExecuteType;
	}

    public NodeType getNodeType() {
        return nodeType;
    }

    public void setNodeType(NodeType nodeType) {
        this.nodeType = nodeType;
    }

}
